<%--
 *  File:    DBManagerSummary.jsp
 *  @Author: TerryCui
 *  Date:    2010/9/7
--%>

<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="com.oval.util.JspHelper" %>

<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  	//init param
  	Category cat = Category.getInstance("jsp.DBManagerSummary");  
  	String privilegeCode = "";
  	String contextPath = request.getContextPath();
  	String strModuleName = "COM";
  	request.getSession(true);
%>

<%@ include file="/inc/FrmDefault.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>

<html>
<head>
<title>DBManagerSummary</title>
<PageFlow:CheckPageFlow pageName="p_dbmanagersummary"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=contextPath%>/console/css/chinese/csscontent.css" type="text/css"> 
<script language="JavaScript" src="<%=contextPath%>/css/cn/script.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/FuncLib.js"></script>
<script language="JavaScript" src="<%=contextPath%>/console/inc/ShowPopup.js"></script>

<script>
function page_search(){
  dmbform.action = "DBManagerSummary.jsp?<%= OvalTools.randomURL() %>";
  dmbform.target = "_self";
  isRunning = true;
  dmbform.submit();
}

function popup(url) {
  var remote = ShowPopup(url,"remoteWindow","scrollbars=yes,location=no,resizable=yes,width=650,height=500");
  remote.focus();
}
</script>
</head>

<body>
<form name="dmbform" method="post" action="<%=contextPath%>/Dispatcher">
	<input type="hidden" name="pagename" value="p_dbmanagersummary">
	<input type="hidden" name="actionname">
	<custom:hidden property="dbtype"/>
	<table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="#999999">
		<tr align="center">
			<td>Service Code:</td><td class="input"><custom:text property="servicecode" size="15" onkeydown="javascript:if(window.event.keyCode == 13)page_search();"/></td> 
			<td>Service Name:</td><td class="input"><custom:text property="servicename" size="15" onkeydown="javascript:if(window.event.keyCode == 13)page_search();"/></td> 
			<td>Service Type:</td><td class="input"><custom:select optionsName="alltypes" property="servicetype" optionValueKey="servicetype" optionInnerTextKey="servicetype" defaultValue="----------------" defaultValueCost=""/>
			<td><input type="button" name="Search" value="Search" onclick="javascript:page_search()"></td>
		</tr>
	</table>
</form>

<table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="#999999">
	<tr>
		<td class="td_title_bg">Service Code</td>
		<td class="td_title_bg">Service Name</td>
		<td class="td_title_bg">Service Type</td>
		<td class="td_title_bg">1th Parameter Name</td>
		<td class="td_title_bg">1st PType</td>
		<td class="td_title_bg">2nd Parameter Name</td>
	</tr>
	
	<%
		Vector ctrlsummary = (Vector)pageContext.getAttribute("ctrlsummary");
		if(ctrlsummary == null) ctrlsummary = new Vector();
		Integer nServiceId = new Integer(-1); 
	%>
	<logic:iterate id="ctrl" collection="<%= ctrlsummary %>">
		<%
			HashMap oneCtrl = (HashMap)pageContext.getAttribute("ctrl");
			nServiceId = (Integer)(oneCtrl.get("serviceid"));
		%>
		<tr class="td_bg_row"> 
			<td class="td_center">
				<div align="left"><a href="javascript:popup('DBManagerInfo.jsp?<%= OvalTools.randomURL() %>&serviceid=<%=JspHelper.filterNull(nServiceId)%>')"><%=JspHelper.filterNull( oneCtrl.get("servicecode") )%></a></div>
			</td>
			<td class="td_center">
				<div align="left"><%=JspHelper.filterNull( oneCtrl.get("servicename") )%></div>
			</td>
			<td class="td_center">
				<div align="left"><%=JspHelper.filterNull( oneCtrl.get("servicetype") )%></div>
			</td>
			<td class="td_center">
				<div align="left"><%=JspHelper.filterNull( oneCtrl.get("parameter1name") )%></div>
			</td>
			<td class="td_center">
				<div align="left"><%=JspHelper.filterNull( oneCtrl.get("parameter1type") )%></div>
			</td>
			<td class="td_center">
				<div align="left"><%=JspHelper.filterNull( oneCtrl.get("parameter2name") )%></div>
			</td>												
		</tr>
	</logic:iterate>
</table>
</body>
</html>


